package com.ganzalang.gmall.designpatterns.template;

import lombok.extern.slf4j.Slf4j;

/**
 * @description: 不使用模板方法
 * @author: ganzalang
 */
@Slf4j
public class WithoutTemplatePatternDemo {

    public static void main(String[] args) {
        DiscountCalculate1 discountCalculate1 = new DiscountCalculate1();
        DiscountCalculate2 discountCalculate2 = new DiscountCalculate2();
        DiscountCalculate3 discountCalculate3 = new DiscountCalculate3();
        discountCalculate1.calculate();
        discountCalculate2.calculate();
        discountCalculate3.calculate();
    }

    public static class DiscountCalculate1 {
        public void calculate() {
            log.info("通用计算1");
            log.info("个性化计算1");
        }
    }

    public static class DiscountCalculate2 {
        public void calculate() {
            log.info("通用计算2");
            log.info("个性化计算2");
        }
    }

    public static class DiscountCalculate3 {
        public void calculate() {
            log.info("通用计算3");
            log.info("个性化计算3");
        }
    }


}
